package io.xccit.product.service.impl;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

import io.xccit.model.product.domain.Product;
import io.xccit.product.service.ProductService;
import org.springframework.stereotype.Service;

/**
 * @author CH_ywx
 * @version 1.0
 * @create 2025/5/17
 * <p></p>
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getProductById(Long id) {
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal("88.88"));
        product.setProductName("《JavaWEB响应式编程实战》");
        product.setNum(100);
        //模拟超时
/*        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }*/
        System.out.println("根据ID获取商品信息接口被调用");
        return product;
    }
}
